/**
 * 项目名称: Topic_1491.cpp
 * 项目路径: study/DataStructure/刷题/一轮/第一天 数组+数学
 * 编辑时间: 2024年09月02日19时31分17秒
 * 用   户: 轻尘
 */

#include <bits/stdc++.h>

using namespace std;

class Solution {
public:
    double average(vector<int> &salary) {
        int low = 1e7;
        int best = 0;
        int sum = 0;
        for (auto x: salary) {
            if (x < low)low = x;
            if (x > best)best = x;
            sum += x;
        }
        if (low != 1e7)sum -= low;
        if (best != 0)sum -= best;

        cout<<sum<<" "<<low<<" "<<best;
        return (double) sum / (salary.size() - 2);
    }
};
